package LuoGu.暴力.火柴棒等式;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt()-4;
        int ans = 0;
        int [] temp = new int []{6,2,5,5,4,5,6,3,7,6};
        int [] tempp = new int [2001];
        for(int i=0;i<10;i++){
            tempp[i] = temp[i];
        }
        for(int i=10;i<=1000;i++){
            int j = i;
            while(j!=0){
                tempp[i]+=temp[j%10];
                j/=10;
            }
        }
        for(int i = 0;i<1001;i++){
            for(int j=0;j<1001;j++){
                if(tempp[i]+tempp[j]+tempp[i+j]==n&&i+j<1000){
                    ans++;
                }
            }
        }
        System.out.print(ans);
    }
}
